function useState<T>(state: T) {
    let currentState = state;
    const changeState = (newState: T) => {
        //定义一个函数
        currentState = newState;
    }

    const tu: [T, (newState: T) => void] = [currentState, changeState];
    // 这里就使用元组比使用数组的好处在于知道类型

    return tu;
}

const [counter, setCounter] = useState(10);
setCounter(1000);

const [title, setTitle] = useState("abcd");

const [flag, setFlag] = useState(true);


export {}
